package main

import (
	"fmt"
	"strconv"
	"core"
)

func main(){
	bc:=core.NewBlockChain()

	bc.AddBlock("发送一个比特币给黄柳淞")
	bc.AddBlock("发送两个比特币给黄柳淞")

	for _,block:=range bc.Blocks{
		fmt.Printf("前一个哈希值: %x\n",block.PrevBlockHash)
		fmt.Printf("数据： %s\n",block.Data)
		fmt.Printf("哈希值： %x\n",block.Hash)

		pow:=core.NewProofofwork(block)
		fmt.Printf("Pow:%s\n",strconv.FormatBool(pow.Validate()))
		fmt.Println()
	}
}
